home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / desktop / drop_12.zip / DROPEXIT.ZIP / EXIT.C next >
C/C++ Source or Header  |  1992-10-08  |  2KB  |  46 lines

  1. #include <windows.h>
  2.  
  3. /*
  4.  
  5. EXIT
  6.  
  7. This program is intended for use with Dropper, a desktop manager.
  8. You can leave it on the desktop, ready for activation.  It allows
  9. you a quick exit from Windows without needing to run a utility like
  10. WinExit, which has to be running in order to react to your
  11. double click, and thus uses up Windows resources.
  12.  
  13. As you can see, it's not the most elaborate program in the world.
  14.  
  15. */
  16.  
  17. int PASCAL WinMain(HANDLE hInstance,
  18.            HANDLE hPrevInstance,
  19.            LPSTR  lpszCmdLine,
  20.            int    nCmdShow)
  21. {
  22.  /***********************************************************************/
  23.  /* HANDLE hInstance;       handle for this instance                    */
  24.  /* HANDLE hPrevInstance;   handle for possible previous instances      */
  25.  /* LPSTR  lpszCmdLine;     long pointer to exec command line           */
  26.  /* int    nCmdShow;        Show code for main window display           */
  27.  Note: When launched normally EXIT will display the Message Box.  If 
  28.  launched as an icon, say, it will call ExitWindows immediately.  To
  29.  use this feature in Dropper, set the Run Minimized checkbox for the
  30.  dropped icon.
  31.  /***********************************************************************/
  32.     if (!hPrevInstance) {
  33.         if ( (nCmdShow != SW_SHOWNORMAL)
  34.         ||
  35.              (IDOK == MessageBox(NULL,
  36.                     "Exit Windows Now ?",
  37.                     "Windows Exit",
  38.                     MB_ICONQUESTION | MB_OKCANCEL))
  39.              )
  40.             ExitWindows(0,0);
  41.  
  42.     }
  43.  
  44. } /*  End of WinMain                                                    */
  45.  
  46.